package com.zmm.type.service;

import com.zmm.common.exception.handle.BusinessException;
import com.zmm.type.model.Category;
import com.zmm.type.vo.CategoryTreeNode;
import com.zmm.type.vo.CategoryVo;

import java.util.List;

/**
 * @Description:
 * @Name CategoryService
 * @Author Zebulon
 * @Date By 2021-06-27 18:55:17
 */
public interface CategoryService {


    /**
     * 新增分类
     * @description:
     * @author: Zebulon
     * @date: 2021-06-27 18:56:10
     * @param category: 
     * @return: java.lang.Integer
     **/
    Integer addCategory(Category category);


    /**
     * 根据 分类Id 查询分类
     * @description:
     * @author: Zebulon
     * @date: 2021-06-27 18:56:15
     * @param categoryId: 
     * @return: com.zmm.type.model.Category
     **/
    Category queryCategoryById(Integer categoryId);

    /**
     * 查询全部的 分类
     * @author: 900045
     * @date: 2021-06-28 16:18:40
     * @throws
	 * @param categoryType:
     * @return: java.util.List<com.zmm.type.vo.CategoryVo>
     **/
	List<CategoryVo> queryAllCategory(Integer categoryType);

	/**
	 * 根据 父ID(也是categoryId) 查询 Category
	 * @author: 900045
	 * @date: 2021-07-05 15:30:26
	 * @throws 
	 * @param parentId: 
	 * @return: com.zmm.type.model.Category
	 **/
	Category findCategoryByParentId(Integer parentId);

	/**
	 * 判断同一级类目下是否存在同名类目
	 * @author: 900045
	 * @date: 2021-07-05 15:39:08
	 * @throws 
	 * @param category: 
	 * @return: boolean
	 **/
	boolean isExistName(Category category);

	/**
	 * 修改 分类
	 * @author: 900045
	 * @date: 2021-07-05 16:15:25
	 * @throws BusinessException
	 * @param category: 
	 * @return: void
	 **/
	void modifyCategory(Category category) throws BusinessException;

	/**
	 * 根据类目id 伪删除
	 * @author: 900045
	 * @date: 2021-07-05 16:32:58
	 * @throws 
	 * @param categoryId: 
	 * @return: java.lang.Integer
	 **/
	Integer removeCategory(Integer categoryId);

	/**
	 * 查询类目节点集合
	 * @author: 900045
	 * @date: 2021-07-05 16:50:15
	 * @throws 
	 * @param categoryType: 
	 * @return: java.util.List<com.zmm.type.vo.CategoryTreeNode>
	 **/
	List<CategoryTreeNode> findCategoryTree(Integer categoryType);

	/**
	 * 查二级类目下是否有三级类目
	 * @author: 900045
	 * @date: 2021-07-05 17:09:38
	 * @throws 
	 * @param category: 
	 * @return: java.util.List<com.zmm.type.model.Category>
	 **/
	List<Category> findThreeCategoryBySecondCategoryId(Category category);
}
